﻿using Abp.Runtime.Validation;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Mt.Site.Application.Organizations.Posts.Dto
{
    public class CreateOrUpdatePostInput: IShouldNormalize
    {
        [Required]
        public PostEditDto Post { get; set; }

        public List<long> GrantedUnitIds { get; set; }

        public List<long> GrantedUserIds { get; set; }

        public void Normalize()
        {
            if (GrantedUnitIds == null)
            {
                GrantedUnitIds = new List<long>();
            }
            if (GrantedUserIds == null)
            {
                GrantedUserIds = new List<long>();
            }
        }
    }
}
